package 强化训练;

import java.util.Scanner;
import java.util.TreeSet;

public class day43求和 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        TreeSet<String> list = new TreeSet<>();

        while(n != 0){
            int y = m;
            int x = n;
            StringBuilder sb = new StringBuilder();
            while(x > 0){
                if (y -x < 0){
                    x--;
                    continue;
                }
                sb.insert(0, x + " ");
                y = y - x;
                x--;
                if(y == 0){
                    sb.delete(sb.length()-1,sb.length());
                    list.add(sb.toString());
                }
            }
            n--;
        }

        for (String s : list){
            System.out.println(s);
        }
    }

}
